/***************************************************************
*  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
*  All rights reserved.
*
*  This file is part of the GroupMe! Project. Source code of 
*  this project is closed and redistribution of this code is
*  prohibited. 
*  
*  Contact: http://www.groupme.net
*
*  This copyright notice MUST APPEAR in all copies of the file!
***************************************************************/
package net.groupme.model.dao;

import net.groupme.model.cache.Cachable;
import net.groupme.model.cache.CachedObjectType;

/**
 * created on Jul 3, 2007
 * 
 * This class provides all table and column names that are used in the database.
 * 
 * @author Fabian Abel, <a href="mailto:abel@l3s.de">abel@l3s.de</a>
 * @author last edited by: $Author: mischa $
 * 
 * @version $Revision: 1.16 $ $Date: 2008-05-14 18:20:04 $
 */
public class DATABASE_CONSTANTS {


	/* Resource.Type */
	/** Resource Type for Groups */
	public static final String RESOURCE_TYPE_GROUP = DBProperties.getString("GroupmeDB.RESOURCE_TYPE_GROUP"); //$NON-NLS-1$
	
	/* TABLES */
	public static final String TABLE_USER = DBProperties	.getString("GroupmeDB.TABLE_USER"); //$NON-NLS-1$
	
	/** table which stores tags (keyword, description,...) */ 
	public static final String TABLE_TAG = DBProperties.getString("GroupmeDB.TABLE_TAG"); //$NON-NLS-1$
	
	/** table which stores the tagging context (user, tag, group, resource) */ 
	public static final String TABLE_USERTAGGROUPRESOURCE = DBProperties.getString("GroupmeDB.TABLE_USERTAGGROUPRESOURCE"); //$NON-NLS-1$

	/** Name of the Table that stores a Statement */
	public static final String TABLE_METADATA = DBProperties.getString("GroupmeDB.table.Metadata"); //$NON-NLS-1$

	/** table which stores resources (name, description,..)*/
	public static final String TABLE_RESOURCE = DBProperties.getString("GroupmeDB.TABLE_RESOURCE"); //$NON-NLS-1$
	
	/** table taht stores cached object (for a single user or at application level)*/
	public static final String TABLE_CACHE = DBProperties.getString("GroupmeDB.TABLE_CACHE"); //$NON-NLS-1$
	
	/** table taht groups of a user*/
	public static final String TABLE_USERGROUP = DBProperties.getString("GroupmeDB.TABLE_USERGROUP"); //$NON-NLS-1$
	
	/** table taht groups of a user*/
	public static final String TABLE_GROUPRESOURCE = DBProperties.getString("GroupmeDB.TABLE_GROUPRESOURCE"); //$NON-NLS-1$
	
	/* COLUMNS */
	
	/* Columns of groupResource Table */
	
	/** the resourceId column within the groupResource table */
	public static final String GROUPRESOURCE_RESOURCE_ID = DBProperties.getString("GroupmeDB.GROUPRESOURCE_RESOURCEID"); //$NON-NLS-1$
	
	/** the groupId column within the groupResource table */
	public static final String GROUPRESOURCE_GROUP_ID = DBProperties.getString("GroupmeDB.GROUPRESOURCE_GROUPID"); //$NON-NLS-1$
	
	
	/* Columns of Tag Table */
	
	/** the ID column within the Tag table */
	public static final String TAG_ID = DBProperties.getString("GroupmeDB.TAG_ID"); //$NON-NLS-1$

	/** the keyword column (= actual tag) within the Tag table */
	public static final String TAG_KEYWORD = DBProperties.getString("GroupmeDB.TAG_KEYWORD"); //$NON-NLS-1$

	/** the description column within the Tag table */
	public static final String TAG_DESCRIPTION = DBProperties.getString("GroupmeDB.TAG_DESCRIPTION"); //$NON-NLS-1$
	
	
	/* Columns of UserTagGroupResource Table (= tagging context) */
	
	/** the ID-of-Tag column within the UserTagGroupResource table */
	public static final String USERTAGGROUPRESOURCE_TAGID = DBProperties.getString("GroupmeDB.USERTAGGROUPRESOURCE_TAGID"); //$NON-NLS-1$

	/** the ID-of-User column within the UserTagGroupResource table */
	public static final String USERTAGGROUPRESOURCE_USERID = DBProperties.getString("GroupmeDB.USERTAGGROUPRESOURCE_USERID"); //$NON-NLS-1$

	/** the ID-of-Resource column within the UserTagGroupResource table */
	public static final String USERTAGGROUPRESOURCE_RESOURCEID = DBProperties.getString("GroupmeDB.USERTAGGROUPRESOURCE_RESOURCEID"); //$NON-NLS-1$

	/** the ID-of-Group column within the UserTagGroupResource table */
	public static final String USERTAGGROUPRESOURCE_GROUPID = DBProperties.getString("GroupmeDB.USERTAGGROUPRESOURCE_GROUPID"); //$NON-NLS-1$

	/** the date column within the UserTagGroupResource table */
	public static final String USERTAGGROUPRESOURCE_DATE = DBProperties.getString("GroupmeDB.USERTAGGROUPRESOURCE_DATE"); //$NON-NLS-1$

	/** the importance column within the UserTagGroupResource table */
	public static final String USERTAGGROUPRESOURCE_IMPORTANCE = DBProperties.getString("GroupmeDB.USERTAGGROUPRESOURCE_IMPORTANCE"); //$NON-NLS-1$
	
	/* Columns within the Metadata table */
	
	/** Name of the attribute which defines the id of the Statement */
	public static final String METADATA_ID = DBProperties.getString("GroupmeDB.Metadata.id"); //$NON-NLS-1$
	
	/** Name of the attribute which defines the Foreign Key to the Resource which is the 
	 * subject of a Statement */
	public static final String METADATA_RESOURCE_ID = DBProperties.getString("GroupmeDB.Metadata.resourceID"); //$NON-NLS-1$
	
	
	
	/* Columns within the Resource table */

	/** the ID column within the Resource table */
	public static final String RESOURCE_ID = DBProperties.getString("GroupmeDB.RESOURCE_ID"); //$NON-NLS-1$

	/** the name column within the Resource table */
	public static final String RESOURCE_NAME = DBProperties.getString("GroupmeDB.RESOURCE_NAME"); //$NON-NLS-1$

	/** the description column within the Resource table */
	public static final String RESOURCE_DESCRIPTION = DBProperties.getString("GroupmeDB.RESOURCE_DESCRIPTION"); //$NON-NLS-1$

	/** the resource-type column within the Resource table */
	public static final String RESOURCE_TYPE = DBProperties.getString("GroupmeDB.RESOURCE_TYPE"); //$NON-NLS-1$

	/** the URL column within the Resource table */
	public static final String RESOURCE_URL = DBProperties.getString("GroupmeDB.RESOURCE_URL"); //$NON-NLS-1$
	
	/** the URL column within the Resource table */
	public static final String RESOURCE_TAD = DBProperties.getString("GroupmeDB.RESOURCE_TAD"); //$NON-NLS-1$
	
	
	/* Columns within the Cache table */

	/** the ID column within the Cache table */
	public static final String CACHE_ID = DBProperties.getString("GroupmeDB.TABLE_CACHE.id"); //$NON-NLS-1$
	
	/** the user ID column within the Cache table */
	public static final String CACHE_USER_ID = DBProperties.getString("GroupmeDB.TABLE_CACHE.userId"); //$NON-NLS-1$
	
	/** the cached object column within the Cache table */
	public static final String CACHE_CACHED_OBJECT = DBProperties.getString("GroupmeDB.TABLE_CACHE.cachedObject"); //$NON-NLS-1$
	
	/** the object type column within the Cache table  (cf. {@link CachedObjectType}) */
	public static final String CACHE_OBJECT_TYPE = DBProperties.getString("GroupmeDB.TABLE_CACHE.objectType"); //$NON-NLS-1$
	
	/** the java class column within the Cache table  (must be a {@link Cachable}) */
	public static final String CACHE_JAVA_CLASS = DBProperties.getString("GroupmeDB.TABLE_CACHE.javaClass"); //$NON-NLS-1$
	
	/** the relatedWithURI column within the Cache table  */
	public static final String CACHE_RELATED_WITH_URI = DBProperties.getString("GroupmeDB.TABLE_CACHE.relatedWith"); //$NON-NLS-1$
	
	
	/* Colums of table userGroup */
	
	/** the user ID column within the userGroup table */
	public static final String USER_GROUP_USER_ID = DBProperties.getString("GroupmeDB.USERGROUP_USER_ID"); //$NON-NLS-1$

	/** the group ID column within the userGroup table */
	public static final String USER_GROUP_GROUP_ID = DBProperties.getString("GroupmeDB.USERGROUP_GROUP_ID"); //$NON-NLS-1$
	
	/** the role column within the userGroup table */
	public static final String USER_GROUP_USERGROUP_ROLE = DBProperties.getString("GroupmeDB.USERGROUP_ROLE"); //$NON-NLS-1$
	
	/** the timestamp column within the userGroup table */
	public static final String USER_GROUP_TAD = DBProperties.getString("GroupmeDB.USERGROUP_TAD"); //$NON-NLS-1$
	
	
	/* LOGGING */
	
	/** table which stores tags (keyword, description,...) */ 
	public static final String TABLE_LOG_EVENT_NAVIGATION = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_NAVIGATION"); //$NON-NLS-1$
	
	/** the user ID column within the LogEventNavigation table */
	public static final String LOG_EVENT_NAVIGATION_USER_ID = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_NAVIGATION.userId"); //$NON-NLS-1$

	/** the Session ID column within the LogEventNavigation table */
	public static final String LOG_EVENT_NAVIGATION_SESSION_ID = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_NAVIGATION.sessionID"); //$NON-NLS-1$

	/** the action ID column within the LogEventNavigation table */
	public static final String LOG_EVENT_NAVIGATION_ACTION = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_NAVIGATION.action"); //$NON-NLS-1$
	
	/** the search string (value) column within the LogEventNavigation table */
	public static final String LOG_EVENT_NAVIGATION_SEARCH_STRING = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_NAVIGATION.value"); //$NON-NLS-1$
	
	/** the resource ID column within the LogEventNavigation table */
	public static final String LOG_EVENT_NAVIGATION_RESOURCE_ID = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_NAVIGATION.resourceId"); //$NON-NLS-1$
	
	/** the timestamp column within the LogEventNavigation table */
	public static final String LOG_EVENT_NAVIGATION_TIMESTAMP = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_NAVIGATION.timestamp"); //$NON-NLS-1$

	
	/** table which stores action events */ 
	public static final String TABLE_LOG_EVENT_ACTION = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_ACTION"); //$NON-NLS-1$
	
	/** the user ID column within the LogEventAction table */
	public static final String TABLE_LOG_EVENT_ACTION_USER_ID = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_ACTION.userId"); //$NON-NLS-1$

	/** the group ID column within the LogEventAction table */
	public static final String TABLE_LOG_EVENT_ACTION_GROUP_ID = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_ACTION.groupId"); //$NON-NLS-1$

	/** the resource ID column within the LogEventAction table */
	public static final String TABLE_LOG_EVENT_ACTION_RESOURCE_ID = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_ACTION.resourceId"); //$NON-NLS-1$
	
	/** the tag string (value) column within the LogEventAction table */
	public static final String TABLE_LOG_EVENT_ACTION_TAG_ID = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_ACTION.tagId"); //$NON-NLS-1$
	
	/** the action column within the LogEventAction table */
	public static final String TABLE_LOG_EVENT_ACTION_ACTION = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_ACTION.action"); //$NON-NLS-1$
	
	/** the timestamp column within the LogEventAction table */
	public static final String TABLE_LOG_EVENT_ACTION_TIME_AND_DATE = DBProperties.getString("GroupmeDB.TABLE_LOG_EVENT_ACTION.timeAndDate"); //$NON-NLS-1$

	/** the Action for a created Group	 */
	public static final String TABLE_LOG_EVENT_ACTION_GROUP_CREATED = "groupCreated";
	
	/** the Action for a deleted Group	 */
	public static final String TABLE_LOG_EVENT_ACTION_GROUP_DELETED = "groupDeleted";
	
	/** the Action for a tagged Group	 */
	public static final String TABLE_LOG_EVENT_ACTION_GROUP_TAGGED = "groupTagged";
	
	/** the Action for a subscription	 */
	public static final String TABLE_LOG_EVENT_ACTION_GROUP_SUBSCRIBED= "groupSubscribed";
	
	/** the Action for an unsubscription	 */
	public static final String TABLE_LOG_EVENT_ACTION_GROUP_UNSUBSCRIBED= "groupUnsubscribed";
	
	/** the Action for a created Resource */
	public static final String TABLE_LOG_EVENT_ACTION_RESOURCE_CREATED= "resourceCreated";

	/** the Action for a removed Resource	 */
	public static final String TABLE_LOG_EVENT_ACTION_RESOURCE_REMOVED= "resourceRemoved";

	/** the Action for a tagged Resource	 */
	public static final String TABLE_LOG_EVENT_ACTION_RESOURCE_TAGGED= "resourceTagged";

	
	/* USER */
	/** the id of the user */
	public static final String USER_ID = DBProperties.getString("GroupmeDB.USER_ID");
	
	/** the username of the user */
	public static final String USER_USERNAME = DBProperties.getString("GroupmeDB.USER_USERNAME");
	
	/** the password of the user */
	public static final String USER_PASSWORD = DBProperties.getString("GroupmeDB.USER_PASSWORD");
	
	/** the role subscriber of a user */
	public static final String User_ROLE_SUBSCRIBER = "subscriber";
	
	/** the role owner of a user */
	public static final String User_ROLE_OWNER = "owner";
	
	/** a photo of the user */
	public static final String USER_PHOTO = DBProperties.getString("GroupmeDB.USER_PHOTO");
	
	/** the time and date when the user registered */
	public static final String USER_TAD = DBProperties.getString("GroupmeDB.USER_TAD");
	
	
	/* USER's ONLINE STATUS */
	
	/** the Table that contains the online status of the user */
	public static final String TABLE_USER_STATUS = DBProperties.getString("GroupmeDB.TableUserStatus");
	
	/** the id of the user */
	public static final String USER_STATUS_USER_ID = DBProperties.getString("GroupmeDB.TableUserStatus.userId");
	
	/** the credential that is stored in both, the client's cookie and the database (in order to be sure that the real user is logged in) */
	public static final String USER_STATUS_CREDENTIAL = DBProperties.getString("GroupmeDB.TableUserStatus.credential");
	
	/** the online status column */
	public static final String USER_STATUS_ONLINE_STATUS = DBProperties.getString("GroupmeDB.TableUserStatus.onlineStatus");
	
	/** online status value that indicates that the user is online (using GroupMe!) at the moment */
	public static final String USER_STATUS_ONLINE_STATUS_ONLINE = DBProperties.getString("GroupmeDB.TableUserStatus.onlineStatus.online");
	
	/** online status value that indicates that the user is logged in via cookies but not using GroupMe! at the moment */
	public static final String USER_STATUS_ONLINE_STATUS_LOGGED_IN_VIA_COOKIE = DBProperties.getString("GroupmeDB.TableUserStatus.onlineStatus.loggedInViaCookie");
	
	/** online status value that indicates that the user is not logged in (also not via a cookie) */
	public static final String USER_STATUS_ONLINE_STATUS_LOGGED_OUT = DBProperties.getString("GroupmeDB.TableUserStatus.onlineStatus.loggedOut");
	
	/** the timestamp of this table */
	public static final String USER_STATUS_TIMESTAMP = DBProperties.getString("GroupmeDB.TableUserStatus.timeAndDate");
	
	
	/* GAME TABLE */
	
	/** the Table that contains the GroupMe! games */
	public static final String TABLE_GAME = DBProperties.getString("GroupmeDB.TableGame");
	
	/** the id of the game table */
	public static final String GAME_ID = DBProperties.getString("GroupmeDB.TableGame.id");
	
	/** the topic of the game table */
	public static final String GAME_TOPIC = DBProperties.getString("GroupmeDB.TableGame.topic");
	
	/** the creator of the game table */
	public static final String GAME_CREATOR = DBProperties.getString("GroupmeDB.TableGame.creator");
	
	/** the opponent of the game table */
	public static final String GAME_OPPONENT = DBProperties.getString("GroupmeDB.TableGame.opponent");
	
	/** the creatorsGroup of the game table */
	public static final String GAME_CREATORS_GROUP = DBProperties.getString("GroupmeDB.TableGame.creatorsGroup");
	
	/** the opponentsGroup of the game table */
	public static final String GAME_OPPONENTS_GROUP = DBProperties.getString("GroupmeDB.TableGame.opponentsGroup");
	
	/** the score of the game table */
	public static final String GAME_SCORE = DBProperties.getString("GroupmeDB.TableGame.score");
	
	/** the gameDuration of the game table */
	public static final String GAME_DURATION = DBProperties.getString("GroupmeDB.TableGame.gameDuration");
	
	/** the settings of the game table */
	public static final String GAME_SETTINGS = DBProperties.getString("GroupmeDB.TableGame.settings");
	
	/** the timestamp of the game table */
	public static final String GAME_TIMESTAMP = DBProperties.getString("GroupmeDB.TableGame.timeAndDate");
	
	
}
